package com.fqyd.campustransaction.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.fqyd.campustransaction.mapper.TypeMapper;
import com.fqyd.campustransaction.model.Type;
import com.fqyd.campustransaction.model.TypeExample;
import com.fqyd.campustransaction.service.TypeService;

/**
 * 类型
 */
@Service
public class TypeServiceImpl implements TypeService {

	@Resource
	private TypeMapper mapper;

	@Override
	public List<Type> getAll() {
		return mapper.selectByExample(new TypeExample());
	}

	@Override
	public void add(Type type) {
		mapper.insert(type);
	}

	@Override
	public void update(Type type) {
		mapper.updateByPrimaryKey(type);
	}

	@Override
	public void delete(String id) {
		mapper.deleteByPrimaryKey(id);
	}

	@Override
	public Type getById(String id) {
		return mapper.selectByPrimaryKey(id);
	}
}
